#include <string>
#include <ctype.h>

using namespace std;

class Solution
{
public:
    string makeGood(string s)
    {
        string ret;
        for (auto ch : s)
        {
            if (!ret.empty() && tolower(ret.back()) == tolower(ch) && ret.back() != ch)
            {
                ret.pop_back();
            }
            else
            {
                ret.push_back(ch);
            }
        }
        return ret;
    }
};